package com.codeyang;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.context.annotation.Bean;
import org.springframework.security.oauth2.config.annotation.web.configuration.EnableAuthorizationServer;
import org.springframework.web.client.RestTemplate;

/**
 * 描述: 认证中心
 * 1.颁发token
 * 2.jwt 非对称加密,把校验的压力给其他调用者,让它们
 * 通过jwt与rsa 私钥签名,公钥解密来校验 jwt token
 *
 * @author CodeYang_Site
 * @version 2021/5/22 22:04
 */
@SpringBootApplication
@EnableEurekaClient
// 认证中心服务
@EnableAuthorizationServer
public class AuthServerApp {

    public static void main(String[] args) {
        SpringApplication.run(AuthServerApp.class,args);
    }

    @Bean
    public RestTemplate restTemplate() {
        return new RestTemplate();
    }

}
